package com.yequan.thread.base.reorder;

public class ReorderClass {

    private int a = 0;

    private boolean flag = false;

    public void write() {
        a = 1;
        flag = true;
    }

    public void read() {
        if (flag) {
            int i = a * a;
            System.out.println(i);
        } else {
            System.out.println("flag为false");
        }
    }


}
